package com.soulless.innerclass.demo2;

/**
 * <p>
 * 即要继承父亲，也要继承母亲
 * </p>
 *
 * @author zenglei
 * @date 2023/05/19/ 15:59
 */
public class Child {

    /**
     * 父亲的商业奇才基因
     */
    public void work() {
        ChildExtendsFather father = new ChildExtendsFather();
        father.work();
    }

    /**
     * 母亲的跳舞奇才基因
     */
    public void dancing() {
        ChildExtendsMother mother = new ChildExtendsMother();
        mother.dancing();
    }

    private class ChildExtendsFather extends Father {
        @Override
        public void work() {
            super.work();
        }
    }

    private class ChildExtendsMother extends Mother {
        @Override
        public void dancing() {
            super.dancing();
        }
    }

}
